home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
p4
/
p4-1_2b.lha
/
p4-1.2b
/
messages
/
vec_slave.c
< prev
Wrap
C/C++ Source or Header
|
1993-02-05
|
553b
|
36 lines
#include "p4.h"
#include "sr_user.h"
slave()
{
int nslaves;
int done;
int type, from, size;
int next;
int my_id;
char *incoming;
my_id = p4_get_my_id();
nslaves = p4_num_total_ids() - 1;
if (my_id == nslaves)
next = 0;
else
next = my_id + 1;
done = FALSE;
while (!done)
{
type = -1;
from = -1;
incoming = NULL;
p4_recv(&type,&from, &incoming, &size);
p4_sendx(type, next, incoming, size, P4INT);
if (type == END)
done = TRUE;
p4_msg_free(incoming);
}
}